<h1>Configuration Management</h1>

<div class="abstract">
  The Configuration Management bundle implements the OSGi defined
  <a  target="_top" href="$(JAVADOCLINK)org/osgi/service/cm/package-summary.html">
    org.orgi.service.cm
  </a>
  package, a uniform way to manage
  bundle configurations.
</div>

<h2>Description</h2>
<p>
  The Configuration Management bundle is designed to be a uniform way
  to handle bundle configuration. It contains the
  <a  target="_top" href="$(JAVADOCLINK)org/osgi/service/cm/ManagedService.html">
    ManagedService
  </a>
  interfaces to be   implemented by bundles that need configuration
  data, and the
  <a  target="_top" href="$(JAVADOCLINK)org/osgi/service/cm/ConfigurationAdmin.html">
    ConfigurationAdmin
  </a>
   service to be used by management bundles that modify configuration data.
<p>
  The ConfigurationAdmin interface is the main interface to the
  Configuration Management component. It is the interface that is
  registered as a service in the Service Registry and it has methods
  for creating, retrieving, and listing configurations. The
  implementation of this interface is responsible for the persistent
  storage of configurations, and listens for registrations of
  ManagedServices and ManagedServiceFactories in the Service Registry
  and passes out configuration data, if available, when they appear.
</p>
<p>
  The
  <a href="../cm_cmd/index.html">cm_commands</a>,
  bundle provides a console command group to Configuration Management.
</p>
<p>
  The
  <a href="../prefs/index.html">Preference Service</a>,
  is an alternative method for storing configuration data but it lacks
  the administrative functions the Configuration Management bundle
  provides.
</p>


<h2><a name="cm_data.dtd">Configuration data as XML files</a></h2>

<p>

  The Knopflerfish CM implementation provides a legacy XML DTD, <a
  href="cm_data.dtd">cm_data.dtd</a>, that specifies one format for
  storing configurations as XML-documents. The Java package <a
  href="../../javadoc/index.html?org/knopflerfish/shared/cm/package-summary.html"><tt>org.knopflerfish.shared.cm</tt></a>
  contains helper classes for writing and reading this XML format.

</p>

<p>

  The cm_data XML-format is used by the import and export commands
  provided by the <a href="../cm_cmd/index.html">cm_commands</a>
  console command bundle.  It is also supported by the <a
  href="../dirdeployer/index.html">Directory Deployer</a> bundle and
  by the Desktop plug-in bundle named <em>CM-Desktop</em>.

</p>

<p>
  Limitations that are not specified <tt>cm_data.dtd</tt>: <ul>

    <li>The mode attribute on configurations and factory
        configurations is deprecated and not used. If present in the
        XML-document set the value to "new" for ordinary configuration
        and "update" for factory configuration instances.

    <li>Properties with a value of type array must have an element
        type that is either a primitive value or one of the types
        defined by the TYPE entity. Make sure that the length
        attribute on the array element is correct, otherwise the
        parsing will fail with strange error messages.

    <li>Properties with a value of type Vector must have all element
        of the same type and that type must be one of the types
        defined by the TYPE entity. Make sure that the length
        attribute on the array element is correct, otherwise the
        parsing will fail with strange error messages.

  </ul>
</p>



<h2>Configuration properties</h2>

<table class="man">
  <tr>
    <th>Name</th>
    <th>Description</th>
    <th>Value type</th>
    <th>Default value</th>
  </tr>
  <tr>
    <td>com.gatespace.bundle.cm.store</td>
    <td>

	Path to a directory that CM will use for its persistent
	storage. The default location when this property is un-set or
	empty is a sub-directory named <tt>cm_store</tt> in the
	bundles data-directory. This means that all configurations are
	lost when the framework is restarted with the <tt>-init</tt>
	option present (i.e., the framework property
	<tt>org.osgi.framework.storage.clean</tt> set to <tt>true</tt>).

	<p>Set this to a path pointing to some writable directory
	outside the frameworks cache directory (<tt>fwdir</tt>) if
	configuration data are to survive <tt>-init</tt> restarts.

    </td>
    <td>String</td>
    <td></td>
  </tr>
</table>


<h2>See Also</h2>
<a href="../cm_cmd/index.html">cm_commands</a>,
<a href="../prefs/index.html">prefs</a>,
